/**
 * Copyright 2009-2011 xiaonei.com All right reserved.
 * This software is the confidential and proprietary information of Xiaonei.com ("Confidential Information"). 
 * You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the license agreement you entered into with Xiaonei.com.
 * Create by XiaoNeiAntiSpamTeam
 *
 */

package com.xiaonei.testice.testamd.client;

import Ice.Communicator;
import Ice.ObjectPrx;

import com.xiaonei.testice.testamd.PrinterPrx;
import com.xiaonei.testice.testamd.PrinterPrxHelper;
import com.xiaonei.testice.util.IceUtil;

/**
 * @ClassName: AMDPrinterClient
 * @Description: AMDPrinter客户端
 * @author shaohui.liu shaohui.liu@opi-corp.com
 * @date Jan 28, 2010 12:11:39 AM
 * 
 */

public class AMDPrinterClient {

    PrinterPrx printerPrx = null;

    public static AMDPrinterClient instance = new AMDPrinterClient();

    public static AMDPrinterClient getInstance() {
        return instance;
    }

    public AMDPrinterClient() {
        Communicator co = Ice.Util.initialize(IceUtil.initData());
        ObjectPrx objectPrx = co.stringToProxy("AMDPrinter@AMDPrinter");
        printerPrx = PrinterPrxHelper.uncheckedCast(objectPrx);
    }

    /**
     * 
     * @Title: print
     * @Description: 打印消息
     * @param @param message
     * @return void
     * @throws
     */
    public void print(String message) {
        try {
            printerPrx.printString(message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
